package com.jhh.pay.ysb;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationListener;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.event.ContextClosedEvent;

import com.jhh.pay.channel.controller.TradeController;

@SpringBootApplication
@ComponentScan("com.jhh.pay")
public class Application {
	
	private static Logger logger = LoggerFactory.getLogger(Application.class);
	
	public static void main(String[] args) {
		ConfigurableApplicationContext cac = SpringApplication.run(Application.class, args);
		
		TradeController tc = cac.getBean(TradeController.class);
		System.out.println(tc);
		cac.addApplicationListener(new ApplicationListener<ContextClosedEvent>() {
			

			@Override
			public void onApplicationEvent(ContextClosedEvent event) {
				if(logger.isDebugEnabled()) {
					logger.debug("--------------------ContextClosed-------------------");
				}
			}
		});
    }
}

